package com.xl.xlyx.serviceImpl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xl.xlyx.dao.EcsCategoryMapper;
import com.xl.xlyx.dao.EcsGoodsAttrMapper;
import com.xl.xlyx.dao.EcsGoodsMapper;
import com.xl.xlyx.entity.EcsCategory;
import com.xl.xlyx.entity.EcsCategoryExample;
import com.xl.xlyx.entity.EcsGoods;
import com.xl.xlyx.entity.EcsGoodsAttr;
import com.xl.xlyx.entity.EcsGoodsAttrExample;
import com.xl.xlyx.entity.EcsGoodsExample;
import com.xl.xlyx.service.GoodsService;

@Service("goodsService")
public class GoodsServiceImpl implements GoodsService {
	@Resource
	private EcsGoodsMapper ecsGoodsMapper;
	@Resource
	private EcsGoodsAttrMapper ecsGoodsAttrMapper;
	@Resource
	private EcsCategoryMapper ecsCategoryMapper;
	
	
	
	public Map<String, Object> getCatGoods() {
		
		Map<String, Object>map=new HashMap<String, Object>();
		EcsCategoryExample e=new EcsCategoryExample();
		short i=0;
		e.createCriteria().andParentIdEqualTo(i).andIsShowEqualTo(true);
		List<EcsCategory> s = ecsCategoryMapper.selectByExample(e);
		for(EcsCategory s11:s) {
			System.out.println(s11.getCatName());
		}
		map.put("cat_goods", s);
		return map;
	}
	
	
	
	
	
	
	
}
